﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Vowei.Core.Models;

namespace Vowei.Data.Models
{
    public class TableEqualityComparer : IEqualityComparer<ITable>
    {
        public bool Equals(ITable x, ITable y)
        {
            if (x == null && y == null)
                return true;
            else if (x == null && y != null)
                return false;
            else if (x != null && y == null)
                return false;
            else
                return x.ID.CompareTo(y.ID) == 0;
        }

        public int GetHashCode(ITable obj)
        {
            return obj.GetHashCode();
        }
    }
}
